import request from '@/utils/request'
// 首页数据
export const getHomeData = () => {
  return request.get('/page/detail')
}
// 商品详情接口
export const getProductDetail = goodsId => {
  return request.get('/goods/detail', {
    params: {
      goodsId: goodsId
    }
  })
}

export const getProdcutGuaranteeService = goodsId => {
  return request.get('/goods.service/list', {
    params: {
      goodsId
    }
  })
}

// 商品全部分类
export const getCategroyList = () => {
  return request.get('/category/list')
}

// 商品评价
export const getCommentList = (params) => {
  return request.get('/comment/list', { params: params })
}

// 商品评价总数
export const getCommentCount = goodsId => {
  return request.get('/comment/total', {
    params: {
      goodsId
    }
  })
}
// 获取限制的商品评论
export const getCommentLimit = params => {
  return request.get('/comment/listRows', { params })
}

// 商品搜索接口
export const productSearch = params => {
  return request.get('/goods/list', { params: { ...params } })
}
